package com.mall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mall.entity.MmallUser;
import com.mall.mapper.MmallUserMapper;
import com.mall.service.MmallUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.utils.MD5Util;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ppmall
 * @since 2021-09-19
 */
@Service
public class MmallUserServiceImpl extends ServiceImpl<MmallUserMapper, MmallUser> implements MmallUserService {

    @Override
    public MmallUser getUser(String username, String password) {
        QueryWrapper<MmallUser> wrapper = new QueryWrapper<>();
        wrapper.eq("username", username);
        wrapper.eq("password", MD5Util.MD5EncodeUtf8(password));
        return baseMapper.selectOne(wrapper);
    }
}
